﻿<cfsilent>
	<cfscript>
		
		event.setArg("pageTitle", "成绩管理 - 成绩修订 - 修改学生成绩");
		
		studentId = event.getArg("STU");
		markId = event.getArg("SMID");
		
		sql = "SELECT 
					 t_course.course_name, 
					 t_student.stu_name, 
					 t_course.mark_mode, 
					 t_student_mark.mark_note, 
					 t_student_mark.mark_result, 
					 t_student_mark.prop_id, 
					 t_student_mark.mark_renote, 
					 t_student_mark.mark_resit 
				FROM 
					 t_student_mark 
					 INNER JOIN t_course ON t_course.cid = t_student_mark.cid 
					 INNER JOIN t_student ON t_student.stu_id = t_student_mark.stu_id 
				WHERE 
					 t_student_mark.scm_id = :markId "; 
		
		queryObj = new Query( datasource=application.dnsMaster );
		queryObj.addParam( name="markId", value=markId, cfsqltype="cf_sql_varchar" );
		
		rs_markEntity = queryObj.execute( sql=sql ).getResult();
				
		passArgs = structNew();
		structInsert(passArgs, "STU", studentId, true);
		
		currentTab = event.getArg("TabID", "labFinal");
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('studentMarkView', passArgs)#</cfoutput>"><i class="mrs img btnPublish"></i><span class="uiButtonText">学生成绩</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 edit"></i>单个成绩修订
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labFinal">class="active"</cfif> id="labFinal" tabTarget="Final">正考成绩</span>
						<span <cfif currentTab eq "labResit">class="active"</cfif> id="labResit" tabTarget="Resit">补考成绩</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
			
				<div id="Final" class="tabContent">
                    	
                         <cfif rs_markEntity.mark_resit gte 60 >
                         	 <div class="noticeBlock">
                               	
                                   <h3>由于补考成绩已经及格，不允许录入重复的正考成绩</h3>
                                 
                              </div>
                         <cfelse>
					
                              <div class="noticeBlock">
                                   <h3><cfoutput>#rs_markEntity.course_name#</cfoutput> - <cfoutput>#rs_markEntity.stu_name#</cfoutput></h3>
                                   <hr />
                              </div>
                              
                              <form id="formFinal" onSubmit="javascript:return processVerfiyForm('formFinal');" class="formWrapper" method="post" action="<cfoutput>#buildURL('studentMarkFinalUpdateDo')#</cfoutput>">
                                   
                                   <input type="hidden" name="MarkID" value="<cfoutput>#markId#</cfoutput>" />
                                   
                                   <!--- 二级制成绩 --->
							<cfif rs_markEntity.mark_mode eq "2">
                                        <div class="label">
                                             <b>课程成绩</b>
                                             <table width="138px">
                                                  <tr>
                                                       <td><input name="MarkNote" type="radio" class="typeRadio" value="Y" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 60>checked="checked"</cfif> /> 合格</td>
                                                       <td><input name="MarkNote" type="radio" class="typeRadio" value="N" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 0>checked="checked"</cfif> /> 不合格</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <div class="label">
                                             <b>备注</b>
                                             <table width="124px">
                                                  <tr>
                                                       <td><input name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "2">checked="checked"</cfif> value="2" /> 缺考</td>
                                                       <td><input name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "3">checked="checked"</cfif> value="3" /> 缓考</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <hr/>
                                        
                                   </cfif>
                                
                                   <!--- 五级制成绩 --->
                                   <cfif rs_markEntity.mark_mode eq "4">
                                        <div class="label">
                                             <b>课程成绩</b>
                                             <table width="420px">
                                                  <tr>
                                                       <td width="60px"><input name="MarkNote" type="radio" class="typeRadio" value="A" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 95>checked="checked"</cfif> /> 优</td>
                                                       <td width="60px"><input name="MarkNote" type="radio" class="typeRadio" value="B" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 85>checked="checked"</cfif> /> 良</td>
                                                       <td width="60px"><input name="MarkNote" type="radio" class="typeRadio" value="C" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 75>checked="checked"</cfif> /> 中</td>
                                                       <td width="60px"><input name="MarkNote" type="radio" class="typeRadio" value="D" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 65>checked="checked"</cfif> /> 及格</td>
                                                       <td width="60px"><input name="MarkNote" type="radio" class="typeRadio" value="E" <cfif rs_markEntity.mark_note eq "1" and rs_markEntity.mark_result eq 0>checked="checked"</cfif> /> 不及格</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <div class="label">
                                             <b>备注</b>
                                             <table width="240px">
                                                  <tr>
                                                       <td><input name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "2">checked="checked"</cfif> value="2" /> 缺考</td>
                                                       <td><input name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "3">checked="checked"</cfif> value="3" /> 缓考</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <hr/>
                                        
                                   </cfif>
                                   
                                   <!--- 百分制成绩 --->
                                   <cfif rs_markEntity.mark_mode eq "0">
                                   
                                        <div class="label">
                                             <b>课程成绩</b>
                                             <input name="Mark" id="Mark" type="text" class="typeTinyInt <cfif rs_markEntity.mark_note neq "1">typeDisable</cfif>" <cfif rs_markEntity.mark_note neq "1">disabled="disabled"</cfif> verification="double" maxlength="5" value="<cfif rs_markEntity.mark_note eq "1"><cfoutput>#numberFormat(event.getArg('Mark', rs_markEntity.mark_result), '0.0')#</cfoutput></cfif>" />
                                        </div>
     
                                        <div class="label">
                                             <b>备注</b>
                                             <table width="320px">
                                                  <tr>
                                                       <td><input onclick="changeScroll('1');" name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "1">checked="checked"</cfif> value="1" /> 正常</td>
                                                       <td><input onclick="changeScroll('2');" name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "2">checked="checked"</cfif> value="2" /> 缺考</td>
                                                       <td><input onclick="changeScroll('3');" name="MarkNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_note eq "3">checked="checked"</cfif> value="3" /> 缓考</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <script language="javascript" type="text/javascript">
                                             //<![CDATA[
                                             <!--
                                             function changeScroll( markNote ) {
     
                                                  var $input = $("input[name='Mark']");
                              
                                                  switch(markNote) {
                                                       case "1":
                                                            $input.val("").removeAttr("disabled").removeClass("typeDisable");
                                                            break;
                                                       case "2":
                                                       case "3":
                                                       case "4":
                                                       case "9":
                                                            $input.val("0").attr("disabled", "disabled").addClass("typeDisable");
                                                            break;
                                                  }
                                             }
                                             // -->
                                             //]]>
                                        </script>
                                        
                                   </cfif>
                                   
                                   <div class="label">
                                        <b>课程性质</b>
                                        <table width="400px">
                                             <tr>
                                                  <td width="33%"><input name="PropID" type="radio" class="typeRadio" <cfif rs_markEntity.prop_id eq "1">checked="checked"</cfif> value="1" />
                                                       必修</td>
                                             </tr>
                                             <tr>
                                                  <td><input name="PropID" type="radio" class="typeRadio" <cfif rs_markEntity.prop_id eq "2">checked="checked"</cfif> value="2" />
                                                       选修</td>
                                             </tr>
                                             <!---<tr>
                                                  <td><input name="PropID" type="radio" class="typeRadio" <cfif rs_markEntity.prop_id eq "3">checked="checked"</cfif> value="3" />
                                                       全校通选课</td>
                                                  <td>&nbsp;</td>
                                                  <td>&nbsp;</td>
                                             </tr>--->
                                        </table>
                                   </div>
     
                                   <hr/>
                                   
                                   <div class="lable">
                                        <input class="button" type="submit" value="更新" />
                                        <cfset structInsert( passArgs, "MarkID", markId, true ) />
                                        <a href="<cfoutput>#buildURL('studentMarkRemoveDo', passArgs)#</cfoutput>" class="button2">删除正考及补考成绩</a>
                                        <cfset structDelete( passArgs, "MarkID", false ) />
                                   </div>
                                   
                              </form>
                              
                           </cfif>
					
				</div>
				
				<div id="Resit" class="tabContent">
                    
                    	<cfif rs_markEntity.mark_result gte 60 >
                         	 <div class="noticeBlock">
                               	
                                   <h3>由于正考成绩已经及格，不允许录入重复的补考成绩</h3>
                                 
                              </div>
                         <cfelse>
					
                              <div class="noticeBlock">
                                   <h3><cfoutput>#rs_markEntity.course_name#</cfoutput> - <cfoutput>#rs_markEntity.stu_name#</cfoutput> 补考</h3>
                                   <hr />
                              </div>
                              
                              <form id="formResit" onSubmit="javascript:return processVerfiyForm('formResit');" class="formWrapper" method="post" action="<cfoutput>#buildURL('studentMarkResitUpdateDo')#</cfoutput>">
                                   
                                   <input type="hidden" name="MarkID" value="<cfoutput>#markId#</cfoutput>" />
                                   
                                   <!--- 二级制成绩 --->
							<cfif rs_markEntity.mark_mode eq "2">
                                        <div class="label">
                                             <b>补考成绩</b>
                                             <table width="200px">
                                                  <tr>
                                                       <td width="30%"><input name="MarkResitNote" type="radio" class="typeRadio" value="Y" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 60>checked="checked"</cfif> /> 合格</td>
                                                       <td width="40%"> <input name="MarkResitNote" type="radio" class="typeRadio" value="N" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 0>checked="checked"</cfif> /> 不合格</td>
                                                        <td width="30%"><input name="MarkResitNote" type="radio" class="typeRadio" value="S"  /> 无</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <div class="label">
                                             <b>备注</b>
                                             <table width="150px">
                                                  <tr>
                                                       <td width="50%"><input name="MarkResitNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_renote eq "2">checked="checked"</cfif> value="2" /> 缺考</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                   </cfif>
                                   
                                   <!--- 五级制成绩 --->
                                   <cfif rs_markEntity.mark_mode eq "4">
                                        <div class="label">
                                             <b>补考成绩</b>
                                             <table width="420px">
                                                  <tr>
                                                       <td width="60px"><input name="MarkResitNote" type="radio" class="typeRadio" value="A" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 95>checked="checked"</cfif> /> 优</td>
                                                       <td width="60px"><input name="MarkResitNote" type="radio" class="typeRadio" value="B" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 85>checked="checked"</cfif> /> 良</td>
                                                       <td width="60px"><input name="MarkResitNote" type="radio" class="typeRadio" value="C" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 75>checked="checked"</cfif> /> 中</td>
                                                       <td width="60px"><input name="MarkResitNote" type="radio" class="typeRadio" value="D" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 65>checked="checked"</cfif> /> 及格</td>
                                                       <td width="60px"><input name="MarkResitNote" type="radio" class="typeRadio" value="E" <cfif rs_markEntity.mark_renote eq "1" and rs_markEntity.mark_resit eq 0>checked="checked"</cfif> /> 不及格</td>
                                                        <td  width="60px"><input name="MarkResitNote" type="radio" class="typeRadio" value="F"  /> 无</td>
                                                  </tr>
                                             </table>
                                             
                                        </div>
                                        
                                        <div class="label">
                                             <b>备注</b>
                                             <table width="150px">
                                                  <tr>
                                                       <td width="50%"><input name="MarkResitNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_renote eq "2">checked="checked"</cfif> value="2" /> 缺考</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                   </cfif>
                                   
                                   <!--- 百分制成绩 --->
                                   <cfif rs_markEntity.mark_mode eq "0">
                                   
                                        <div class="label">
                                             <b>补考成绩</b>
                                             <input name="MarkResit" id="MarkResit" type="text" class="typeTinyInt <cfif rs_markEntity.mark_renote neq "1">typeDisable</cfif>" <cfif rs_markEntity.mark_renote neq "1">disabled="disabled"</cfif> verification="double" maxlength="5" value="<cfif rs_markEntity.mark_resit gte 0><cfoutput>#numberFormat(event.getArg('MarkResit', rs_markEntity.mark_resit), '0.0')#</cfoutput></cfif>" />(如果要把补考成绩去掉，请输入'-1'，如果输入0也表示有成绩)
                                        </div>
                                        
                                        <div class="label">
                                             <b>备注</b>
                                             <table width="220px">
                                                  <tr>
                                                       <td><input onclick="changeResitScroll('1');" name="MarkResitNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_renote eq "1">checked="checked"</cfif> value="1" /> 正常</td>
                                                       <td><input onclick="changeResitScroll('2');" name="MarkResitNote" type="radio" class="typeRadio" <cfif rs_markEntity.mark_renote eq "2">checked="checked"</cfif> value="2" /> 缺考</td>
                                                  </tr>
                                             </table>
                                        </div>
                                        
                                        <script language="javascript" type="text/javascript">
                                             //<![CDATA[
                                             <!--
                                             function changeResitScroll( markNote ) {
     
                                                  var $input = $("input[name='MarkResit']");
                              
                                                  switch(markNote) {
                                                       case "1":
                                                            $input.val("").removeAttr("disabled").removeClass("typeDisable");
                                                            break;
                                                       case "2":
                                                       case "9":
                                                            $input.val("0").attr("disabled", "disabled").addClass("typeDisable");
                                                            break;
                                                  }
                                             }
                                             // -->
                                             //]]>
                                        </script>
                                        
                                   </cfif>
                                   
                                   <hr/>
                                   
                                   <div class="lable">
                                        <input class="button" type="submit" value="更新" />
                                   </div>
                                   
                              </form>
                              
                          </cfif>
					
				</div>
				
			</div>
		</li>
	</ul>
</div>